package s03;

public class F02 {
	public static String getMessage(String shortMessage,String xh,String xm) {
		StringBuilder sb = new StringBuilder();
		sb.append("电话 [").append(shortMessage.substring(0, 11)).append("]\n学号 [");
		int p1 = shortMessage.indexOf(xh);
		int p2 = shortMessage.lastIndexOf(xm);
		sb.append(shortMessage.substring(p1+xh.length(), p2)).append("]\n姓名 [");
		sb.append(shortMessage.substring(p2+xm.length())).append("]\n");
		return sb.toString();
	}
	public static void main(String[] args) {
		String s="13838818503 2016/2/29 8:13:58 <xuehao>20154205917<xm>陈博";
		String mess = getMessage(s,"<xuehao>","<xm>");
		System.out.println(mess);
	}

}
